# -*- coding: utf-8 -*-
# @Time    : 2018-02-19 17:20
# @Author  : Wesley
# @File    : lesson3-grepword.py
# @TODO    : 

dic = dict()

def readFile():
    file = "data/dicData.txt"
    f = open(file,"r",encoding="UTF8")
    for line in f :
        line = line.strip()

        print("***********this line is:"+line)

        dicVal = dic.values()
        if dicVal is not None :
            lineValues = line.split(",")
            for lv in lineValues:
                if lv not in dic.keys():
                    dic[lv] = 1
                else:
                    num = dic.get(lv)
                    num = num+1
                    dic[lv]=num


def printDic():
    readFile()
    for key,value in dic.items():
        print("Key : "+key+"---- Value:"+repr(value))




printDic()